#include "scrollarea.h"
#include <QResizeEvent>

ScrollArea::ScrollArea(QWidget *parent)
	: QScrollArea(parent)
{
}

void ScrollArea::onMakeVisible(const QRect & rect)
{
    ensureVisible(rect.center().x(), rect.center().y(), rect.width()/2, rect.height()/2);
}

void ScrollArea::resizeEvent(QResizeEvent * e)
{
    QScrollArea::resizeEvent(e);
    QWidget * w = widget();
    if(w)
        w->setFixedWidth(e->size().width());
}
